﻿using System;
using Quail;
using Quail.Silverlight;
using QuailTest.Silverlight;

namespace QuailTest.Pages
{
    public class Demo6Page : WebPage
    {
        private readonly Lazy<SilverlightControl> _silverlight;

        public Demo6Page(WebBrowser browser)
            : base(browser)
        {
            _silverlight = new Lazy<SilverlightControl>( () => new SilverlightControl(this, "silverlight"));
        }

        public SilverlightControl Silverlight
        {
            get
            {
                return _silverlight.Value;
            }
        }

        public override void NavigateToThisPage()
        {
            Browser.Navigate("/HelloWorld/Demo6.aspx", this);
        }

        protected override bool IsThisPage()
        {
            return Location.EndsWith("/HelloWorld/Demo6.aspx");
        }

        public class SilverlightControl : SlvContainer
        {
            private readonly HelloWorldSlvDemo6 _demo6;

            public SilverlightControl(WebControlContainer page, string name)
                : base(page, name)
            {
                _demo6 = new HelloWorldSlvDemo6(this);
            }

            public HelloWorldSlvDemo6 Demo6Page
            {
                get
                {
                    return _demo6;
                }
            }
        }
    }
}
